import Vue from 'vue'

const axios = Vue.$axios

export const GetListApi = () => {
    return axios({
        url: '/apis',
        method: 'get'
    })
}

export const GetOneApi = (id) => {
    return axios({
        url: '/apis/' + id,
        method: 'get'
    })
}

export const CreateOneApi = (data) => {
    return axios({
        url: '/apis',
        method: 'post',
        data: data
    })
}

export const UpdateOneApi = (data) => {
    return axios({
        url: '/apis' + '/' + data.id,
        method: 'put',
        data: data
    })
}

export const PatchOneApi = (data) => {
    return axios({
        url: '/apis' + "/" + data.id,
        method: 'patch',
        data: data
    })
}

export const RemoveOneApi = (id) => {
    return axios({
        url: '/apis/' + id,
        method: 'delete',
    })
}